3.570 \(\int \frac{A+B \cos (c+d x)}{(a+b \cos (c+d x)) \sqrt{\sec (c+d x)}} \, dx\)

Optimal. Leaf size=149 \[ \frac{2 (A b-a B) \sqrt{\cos (c+d x)} \sqrt{\sec (c+d x)} F\left (\left .\frac{1}{2} (c+d x)\right |2\right )}{b^2 d}-\frac{2 a (A b-a B) \sqrt{\cos (c+d x)} \sqrt{\sec (c+d x)} \Pi \left (\frac{2 b}{a+b};\left .\frac{1}{2} (c+d x)\right |2\right )}{b^2 d (a+b)}+\frac{2 B \sqrt{\cos (c+d x)} \sqrt{\sec (c+d x)} E\left (\left .\frac{1}{2} (c+d x)\right |2\right )}{b d} \]

[Out]

(2*B*Sqrt[Cos[c + d*x]]*EllipticE[(c + d*x)/2, 2]*Sqrt[Sec[c + d*x]])/(b*d) + (2*(A*b - a*B)*Sqrt[Cos[c + d*x]
]*EllipticF[(c + d*x)/2, 2]*Sqrt[Sec[c + d*x]])/(b^2*d) - (2*a*(A*b - a*B)*Sqrt[Cos[c + d*x]]*EllipticPi[(2*b)
/(a + b), (c + d*x)/2, 2]*Sqrt[Sec[c + d*x]])/(b^2*(a + b)*d)

________________________________________________________________________________________

Rubi [A]  time = 0.346273, antiderivative size = 149, normalized size of antiderivative = 1., number of steps used = 8, number of rules used = 8, integrand size = 33, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.242, Rules used = {2960, 4038, 3771, 2639, 3848, 2803, 2641, 2805} \[ \frac{2 (A b-a B) \sqrt{\cos (c+d x)} \sqrt{\sec (c+d x)} F\left (\left .\frac{1}{2} (c+d x)\right |2\right )}{b^2 d}-\frac{2 a (A b-a B) \sqrt{\cos (c+d x)} \sqrt{\sec (c+d x)} \Pi \left (\frac{2 b}{a+b};\left .\frac{1}{2} (c+d x)\right |2\right )}{b^2 d (a+b)}+\frac{2 B \sqrt{\cos (c+d x)} \sqrt{\sec (c+d x)} E\left (\left .\frac{1}{2} (c+d x)\right |2\right )}{b d} \]

Antiderivative was successfully verified.

[In]

Int[(A + B*Cos[c + d*x])/((a + b*Cos[c + d*x])*Sqrt[Sec[c + d*x]]),x]

[Out]

(2*B*Sqrt[Cos[c + d*x]]*EllipticE[(c + d*x)/2, 2]*Sqrt[Sec[c + d*x]])/(b*d) + (2*(A*b - a*B)*Sqrt[Cos[c + d*x]
]*EllipticF[(c + d*x)/2, 2]*Sqrt[Sec[c + d*x]])/(b^2*d) - (2*a*(A*b - a*B)*Sqrt[Cos[c + d*x]]*EllipticPi[(2*b)
/(a + b), (c + d*x)/2, 2]*Sqrt[Sec[c + d*x]])/(b^2*(a + b)*d)

Rule 2960

Int[(csc[(e_.) + (f_.)*(x_)]*(g_.))^(p_.)*((a_.) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*((c_) + (d_.)*sin[(e_.
) + (f_.)*(x_)])^(n_.), x_Symbol] :> Dist[g^(m + n), Int[(g*Csc[e + f*x])^(p - m - n)*(b + a*Csc[e + f*x])^m*(
d + c*Csc[e + f*x])^n, x], x] /; FreeQ[{a, b, c, d, e, f, g, p}, x] && NeQ[b*c - a*d, 0] &&  !IntegerQ[p] && I
ntegerQ[m] && IntegerQ[n]

Rule 4038

Int[((csc[(e_.) + (f_.)*(x_)]*(d_.))^(n_)*(csc[(e_.) + (f_.)*(x_)]*(B_.) + (A_)))/(csc[(e_.) + (f_.)*(x_)]*(b_
.) + (a_)), x_Symbol] :> Dist[A/a, Int[(d*Csc[e + f*x])^n, x], x] - Dist[(A*b - a*B)/(a*d), Int[(d*Csc[e + f*x
])^(n + 1)/(a + b*Csc[e + f*x]), x], x] /; FreeQ[{a, b, d, e, f, A, B, n}, x] && NeQ[A*b - a*B, 0] && NeQ[a^2
- b^2, 0]

Rule 3771

Int[(csc[(c_.) + (d_.)*(x_)]*(b_.))^(n_), x_Symbol] :> Dist[(b*Csc[c + d*x])^n*Sin[c + d*x]^n, Int[1/Sin[c + d
*x]^n, x], x] /; FreeQ[{b, c, d}, x] && EqQ[n^2, 1/4]

Rule 2639

Int[Sqrt[sin[(c_.) + (d_.)*(x_)]], x_Symbol] :> Simp[(2*EllipticE[(1*(c - Pi/2 + d*x))/2, 2])/d, x] /; FreeQ[{
c, d}, x]

Rule 3848

Int[Sqrt[csc[(e_.) + (f_.)*(x_)]*(d_.)]/(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_)), x_Symbol] :> Dist[(Sqrt[d*Sin[
e + f*x]]*Sqrt[d*Csc[e + f*x]])/d, Int[Sqrt[d*Sin[e + f*x]]/(b + a*Sin[e + f*x]), x], x] /; FreeQ[{a, b, d, e,
 f}, x] && NeQ[a^2 - b^2, 0]

Rule 2803

Int[Sqrt[(c_.) + (d_.)*sin[(e_.) + (f_.)*(x_)]]/((a_.) + (b_.)*sin[(e_.) + (f_.)*(x_)]), x_Symbol] :> Dist[d/b
, Int[1/Sqrt[c + d*Sin[e + f*x]], x], x] + Dist[(b*c - a*d)/b, Int[1/((a + b*Sin[e + f*x])*Sqrt[c + d*Sin[e +
f*x]]), x], x] /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d, 0] && NeQ[a^2 - b^2, 0] && NeQ[c^2 - d^2, 0]

Rule 2641

Int[1/Sqrt[sin[(c_.) + (d_.)*(x_)]], x_Symbol] :> Simp[(2*EllipticF[(1*(c - Pi/2 + d*x))/2, 2])/d, x] /; FreeQ
[{c, d}, x]

Rule 2805

Int[1/(((a_.) + (b_.)*sin[(e_.) + (f_.)*(x_)])*Sqrt[(c_.) + (d_.)*sin[(e_.) + (f_.)*(x_)]]), x_Symbol] :> Simp
[(2*EllipticPi[(2*b)/(a + b), (1*(e - Pi/2 + f*x))/2, (2*d)/(c + d)])/(f*(a + b)*Sqrt[c + d]), x] /; FreeQ[{a,
 b, c, d, e, f}, x] && NeQ[b*c - a*d, 0] && NeQ[a^2 - b^2, 0] && NeQ[c^2 - d^2, 0] && GtQ[c + d, 0]

Rubi steps

\begin{align*} \int \frac{A+B \cos (c+d x)}{(a+b \cos (c+d x)) \sqrt{\sec (c+d x)}} \, dx &=\int \frac{B+A \sec (c+d x)}{\sqrt{\sec (c+d x)} (b+a \sec (c+d x))} \, dx\\ &=\frac{B \int \frac{1}{\sqrt{\sec (c+d x)}} \, dx}{b}-\frac{(-A b+a B) \int \frac{\sqrt{\sec (c+d x)}}{b+a \sec (c+d x)} \, dx}{b}\\ &=\frac{\left (B \sqrt{\cos (c+d x)} \sqrt{\sec (c+d x)}\right ) \int \sqrt{\cos (c+d x)} \, dx}{b}-\frac{\left ((-A b+a B) \sqrt{\cos (c+d x)} \sqrt{\sec (c+d x)}\right ) \int \frac{\sqrt{\cos (c+d x)}}{a+b \cos (c+d x)} \, dx}{b}\\ &=\frac{2 B \sqrt{\cos (c+d x)} E\left (\left .\frac{1}{2} (c+d x)\right |2\right ) \sqrt{\sec (c+d x)}}{b d}-\frac{\left ((-A b+a B) \sqrt{\cos (c+d x)} \sqrt{\sec (c+d x)}\right ) \int \frac{1}{\sqrt{\cos (c+d x)}} \, dx}{b^2}+\frac{\left (a (-A b+a B) \sqrt{\cos (c+d x)} \sqrt{\sec (c+d x)}\right ) \int \frac{1}{\sqrt{\cos (c+d x)} (a+b \cos (c+d x))} \, dx}{b^2}\\ &=\frac{2 B \sqrt{\cos (c+d x)} E\left (\left .\frac{1}{2} (c+d x)\right |2\right ) \sqrt{\sec (c+d x)}}{b d}+\frac{2 (A b-a B) \sqrt{\cos (c+d x)} F\left (\left .\frac{1}{2} (c+d x)\right |2\right ) \sqrt{\sec (c+d x)}}{b^2 d}-\frac{2 a (A b-a B) \sqrt{\cos (c+d x)} \Pi \left (\frac{2 b}{a+b};\left .\frac{1}{2} (c+d x)\right |2\right ) \sqrt{\sec (c+d x)}}{b^2 (a+b) d}\\ \end{align*}

Mathematica [A]  time = 6.14245, size = 224, normalized size = 1.5 \[ \frac{\cot (c+d x) \left (-2 A b \sqrt{-\tan ^2(c+d x)} \Pi \left (-\frac{a}{b};\left .-\sin ^{-1}\left (\sqrt{\sec (c+d x)}\right )\right |-1\right )+2 a B \sqrt{-\tan ^2(c+d x)} \Pi \left (-\frac{a}{b};\left .-\sin ^{-1}\left (\sqrt{\sec (c+d x)}\right )\right |-1\right )+b B \sec ^{\frac{7}{2}}(c+d x)-b B \sec ^{\frac{3}{2}}(c+d x)+b B \cos (2 (c+d x)) \sec ^{\frac{7}{2}}(c+d x)-b B \cos (2 (c+d x)) \sec ^{\frac{3}{2}}(c+d x)+2 b B \sqrt{-\tan ^2(c+d x)} F\left (\left .\sin ^{-1}\left (\sqrt{\sec (c+d x)}\right )\right |-1\right )-2 b B \sqrt{-\tan ^2(c+d x)} E\left (\left .\sin ^{-1}\left (\sqrt{\sec (c+d x)}\right )\right |-1\right )\right )}{b^2 d} \]

Antiderivative was successfully verified.

[In]

Integrate[(A + B*Cos[c + d*x])/((a + b*Cos[c + d*x])*Sqrt[Sec[c + d*x]]),x]

[Out]

(Cot[c + d*x]*(-(b*B*Sec[c + d*x]^(3/2)) - b*B*Cos[2*(c + d*x)]*Sec[c + d*x]^(3/2) + b*B*Sec[c + d*x]^(7/2) +
b*B*Cos[2*(c + d*x)]*Sec[c + d*x]^(7/2) - 2*b*B*EllipticE[ArcSin[Sqrt[Sec[c + d*x]]], -1]*Sqrt[-Tan[c + d*x]^2
] + 2*b*B*EllipticF[ArcSin[Sqrt[Sec[c + d*x]]], -1]*Sqrt[-Tan[c + d*x]^2] - 2*A*b*EllipticPi[-(a/b), -ArcSin[S
qrt[Sec[c + d*x]]], -1]*Sqrt[-Tan[c + d*x]^2] + 2*a*B*EllipticPi[-(a/b), -ArcSin[Sqrt[Sec[c + d*x]]], -1]*Sqrt
[-Tan[c + d*x]^2]))/(b^2*d)

________________________________________________________________________________________

Maple [A]  time = 3.76, size = 295, normalized size = 2. \begin{align*} -2\,{\frac{\sqrt{ \left ( 2\, \left ( \cos \left ( 1/2\,dx+c/2 \right ) \right ) ^{2}-1 \right ) \left ( \sin \left ( 1/2\,dx+c/2 \right ) \right ) ^{2}}\sqrt{ \left ( \sin \left ( 1/2\,dx+c/2 \right ) \right ) ^{2}}\sqrt{-2\, \left ( \cos \left ( 1/2\,dx+c/2 \right ) \right ) ^{2}+1}}{ \left ( a-b \right ){b}^{2}\sqrt{-2\, \left ( \sin \left ( 1/2\,dx+c/2 \right ) \right ) ^{4}+ \left ( \sin \left ( 1/2\,dx+c/2 \right ) \right ) ^{2}}\sin \left ( 1/2\,dx+c/2 \right ) \sqrt{2\, \left ( \cos \left ( 1/2\,dx+c/2 \right ) \right ) ^{2}-1}d} \left ( A{\it EllipticF} \left ( \cos \left ( 1/2\,dx+c/2 \right ) ,\sqrt{2} \right ) ab-A{\it EllipticF} \left ( \cos \left ( 1/2\,dx+c/2 \right ) ,\sqrt{2} \right ){b}^{2}-A{\it EllipticPi} \left ( \cos \left ( 1/2\,dx+c/2 \right ) ,-2\,{\frac{b}{a-b}},\sqrt{2} \right ) ab-B{\it EllipticF} \left ( \cos \left ( 1/2\,dx+c/2 \right ) ,\sqrt{2} \right ){a}^{2}+B{\it EllipticF} \left ( \cos \left ( 1/2\,dx+c/2 \right ) ,\sqrt{2} \right ) ab-B{\it EllipticE} \left ( \cos \left ( 1/2\,dx+c/2 \right ) ,\sqrt{2} \right ) ab+B{\it EllipticE} \left ( \cos \left ( 1/2\,dx+c/2 \right ) ,\sqrt{2} \right ){b}^{2}+B{\it EllipticPi} \left ( \cos \left ( 1/2\,dx+c/2 \right ) ,-2\,{\frac{b}{a-b}},\sqrt{2} \right ){a}^{2} \right ) } \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((A+B*cos(d*x+c))/(a+b*cos(d*x+c))/sec(d*x+c)^(1/2),x)

[Out]

-2*((2*cos(1/2*d*x+1/2*c)^2-1)*sin(1/2*d*x+1/2*c)^2)^(1/2)*(sin(1/2*d*x+1/2*c)^2)^(1/2)*(-2*cos(1/2*d*x+1/2*c)
^2+1)^(1/2)*(A*EllipticF(cos(1/2*d*x+1/2*c),2^(1/2))*a*b-A*EllipticF(cos(1/2*d*x+1/2*c),2^(1/2))*b^2-A*Ellipti
cPi(cos(1/2*d*x+1/2*c),-2*b/(a-b),2^(1/2))*a*b-B*EllipticF(cos(1/2*d*x+1/2*c),2^(1/2))*a^2+B*EllipticF(cos(1/2
*d*x+1/2*c),2^(1/2))*a*b-B*EllipticE(cos(1/2*d*x+1/2*c),2^(1/2))*a*b+B*EllipticE(cos(1/2*d*x+1/2*c),2^(1/2))*b
^2+B*EllipticPi(cos(1/2*d*x+1/2*c),-2*b/(a-b),2^(1/2))*a^2)/b^2/(a-b)/(-2*sin(1/2*d*x+1/2*c)^4+sin(1/2*d*x+1/2
*c)^2)^(1/2)/sin(1/2*d*x+1/2*c)/(2*cos(1/2*d*x+1/2*c)^2-1)^(1/2)/d

________________________________________________________________________________________

Maxima [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{B \cos \left (d x + c\right ) + A}{{\left (b \cos \left (d x + c\right ) + a\right )} \sqrt{\sec \left (d x + c\right )}}\,{d x} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((A+B*cos(d*x+c))/(a+b*cos(d*x+c))/sec(d*x+c)^(1/2),x, algorithm="maxima")

[Out]

integrate((B*cos(d*x + c) + A)/((b*cos(d*x + c) + a)*sqrt(sec(d*x + c))), x)

________________________________________________________________________________________

Fricas [F(-1)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((A+B*cos(d*x+c))/(a+b*cos(d*x+c))/sec(d*x+c)^(1/2),x, algorithm="fricas")

[Out]

Timed out

________________________________________________________________________________________

Sympy [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{A + B \cos{\left (c + d x \right )}}{\left (a + b \cos{\left (c + d x \right )}\right ) \sqrt{\sec{\left (c + d x \right )}}}\, dx \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((A+B*cos(d*x+c))/(a+b*cos(d*x+c))/sec(d*x+c)**(1/2),x)

[Out]

Integral((A + B*cos(c + d*x))/((a + b*cos(c + d*x))*sqrt(sec(c + d*x))), x)

________________________________________________________________________________________

Giac [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{B \cos \left (d x + c\right ) + A}{{\left (b \cos \left (d x + c\right ) + a\right )} \sqrt{\sec \left (d x + c\right )}}\,{d x} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((A+B*cos(d*x+c))/(a+b*cos(d*x+c))/sec(d*x+c)^(1/2),x, algorithm="giac")

[Out]

integrate((B*cos(d*x + c) + A)/((b*cos(d*x + c) + a)*sqrt(sec(d*x + c))), x)